'use strict';

const {Service}=require('egg');

class AddressService extends Service {l
    // 获取数据库中的数据
    async getList(id){
        if(id){
            return await this.app.mysql.get('address',{id});
        }
        return await this.app.mysql.select('address');
    }

    async removeList(id){
        return await this.app.mysql.delete('address',{id})
    }

    async updateList(id,body){
        return await this.app.mysql.update('address',body,{where:{id}})
    }

    async addList(body){
        return await this.app.mysql.insert('address',body);
    }
}

module.exports = AddressService;